<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<base href="${base}" />
<meta charset="UTF-8" />
<title>个人资料 - 会员中心 - 人才系统</title>
<link rel="shortcut icon" href="favicon.ico" />
<link href="styles/user.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.9.1.js"></script>
<script  type="text/javascript" src="laydate/laydate.js"></script>
</head>
<style>
#image{
margin-left:75px;
}
</style>

<script type="text/javascript">
$(function(){
	 laydate.render({
		elem :'#birthday'
	}); 
});
/**
 *填写用户信息
 */
function updateProfile(){

	let realname=$("#realname").val();
	if(realname==""){
		alert("真实姓名不能为空");
		return
		}
	let phone=$("#phone").val();
	if(phone==""){
		alert("电话号码不能为空");
		return
		}
 
	 $.ajax({
		url :"/user/updateProfile",
		type : "post",
		dataType : "JSON",
		data : $("#Form1").serialize(),
		success : function(data) {
			var vo = data;
			if (vo.code == 200) {
				alert(vo.meg);
				
			} else {
				alert(vo.meg);
			}
		}

	});  
}
</script>
<body>
	<jsp:include page="../header.jsp"></jsp:include>
	<!--导航 -->
	<div class="floatnav">
		<jsp:include page="../nav.jsp"></jsp:include>
	</div>
	<!--导航end -->
	<div class="page_location link_bk">
		当前位置：<a href="">首页</a>&nbsp;>>&nbsp;<a href="personal/">会员中心</a>&nbsp;>>&nbsp;账户管理&nbsp;>>&nbsp;基本资料
	</div>
	<table width="985" border="0" align="center" cellpadding="0"
		cellspacing="0" style="margin-top: 8px;">
		<tr>
			<td width="173" valign="top" class="link_bk"><jsp:include
					page="left.jsp"></jsp:include></td>
			<td valign="top">
				<div class="user_right_box">
					<div class="user_right_top_tit_bg">
						<h1>个人资料</h1>
					</div>
					<div class="us_tab">
						<a href="user/meg" class="select">基本资料</a> <a href="jsp/personal/email_validate.jsp">认证邮箱</a> <a href="jsp/personal/user_avatar.jsp">修改头像</a>
						<a href="jsp/personal/user_password.jsp">密码修改</a>
						<div class="clear"></div>
					</div>
					<div id="image" >
						用户头像：
						<c:if test="${user.avatar!=null}">   
      						<img src="${user.avatar}" width="40px" height="40px">
   						</c:if>
   						<c:if test="${user.avatar==null||user.avatar==''}"> 
   						 	<img alt="" src="" width="40px" height="40px">
   							<form action="user/userAvatar" method="post" enctype="multipart/form-data">
								<input type="file" name="avatarImg" value="上传头像"></br>
								<input type="submit" value="上传"> 
							</form> 	
   						</c:if>			
					</div>
					<form id="Form1" name="Form1" method="post"
						action="?act=userprofile_save">
						<table width="100%" border="0" cellpadding="4" cellspacing="0"
							style="margin-top: 10px;">
							<tr>
								<td width="120" height="30" align="right">用户名：</td>
								<td>${user.account}</td>
							</tr>
							<tr>
								<td height="30" align="right">注册邮箱:</td>
								<td>${user.email}&nbsp;&nbsp;<a href="jsp/personal/email_validate.jsp"> [点击认证]</a>


								</td>
							</tr>
							<tr>
								<td height="30" align="right"><span
									style="color: #FF3300; font-weight: bold">*</span>真实姓名：</td>
								<td><input name="realName" type="text"
									class="input_text_200" id="realname" maxlength="10" value="" /></td>
							</tr>
							<tr>
								<td height="30" align="right">性别：</td>
								<td><label><input name="gender" type="radio" value="男"
										checked="checked" /> 男</label>&nbsp;&nbsp; <label><input
										type="radio" name="gender" value="女" />女</label>&nbsp;&nbsp;</td>
							</tr>
							<tr>
								<td height="30" align="right">生日：</td>
								<td><input name="birthdate" type="text"
									class="input_text_200" id="birthday" maxlength="50" /></td>
							</tr>
							<tr>
								<td height="30" align="right">通讯地址：</td>
								<td><input name="address" type="text"
									class="input_text_200" id="addresses" maxlength="150" value="" /></td>
							</tr>

							<tr>
								<td align="right"><span
									style="color: #FF3300; font-weight: bold">*</span>联系电话：</td>
								<td><input name="telephone" type="text" class="input_text_200"
									id="phone" maxlength="60" value="" /></td>
							</tr>
							<tr>
								<td height="30" align="right">QQ：</td>
								<td><input name="qq" type="text" class="input_text_200"
									id="qq" maxlength="30" value="" /></td>
							</tr>
							<tr>
								<td height="30" align="right">个人简介：</td>
								<td><textarea name="profile" cols="" rows=""
										class="input_text_200_textarea"></textarea></td>
							</tr>
							<tr>
								<td height="30" align="right">&nbsp;</td>
								<td><input type="button" name="Submit" onclick="updateProfile()" value="保存"
									class="user_submit" /></td>
							</tr>
							<tr>
								<td height="30" align="right">&nbsp;</td>
								<td></td>
							</tr>
						</table>
					</form>
				</div>
			</td>
		</tr>
	</table>
	<jsp:include page="../footer.jsp"></jsp:include>

</body>
</html>
